﻿@{
    Layout = "~/Views/Shared/_Index.cshtml";
 }
<div class="container-div">
    <div class="row">
        <div id="searchDiv" class="col-sm-12 search-collapse">
            <div class="select-list">
                <ul>
                    <li>
                        流媒体服务：<span id="mediaserverId" col="mediaServerId"></span>
                    </li>
                </ul>
            </div>
        </div>
        <div class="btn-group-sm hidden-xs" id="toolbar">

        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="gridTable" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
         $("#mediaserverId").ysComboBox({
            url: '@Url.Content("~/CameraManage/CameraSessionManager/GetPushMediaList")',
            key: "mediaServerId",
            value: "mediaServerId",
            default: "vm_linux"
        });
        initGrid();
    });

    function initGrid() {
        var queryUrl = '@Url.Content("~/CameraManage/PlaySessionManager/PlaySessionList")';
        $('#gridTable').ysTable({
            url: queryUrl,
            columns: [
                { checkbox: false, visible: false },
                { field: 'cameraId', title: '设备ID' },
                { field: 'streamId', title: '流ID' },
                { field: 'clientType', title: '客户端类型' },
                { field: 'mediaServerId', title: '流媒体ID' },
                { field: 'mediaServerIp', title: '流媒体IP' },
                { field: 'playUrl', title: '播放地址' },
                { field: 'playerIp', title: '播放者IP' },
                { field: 'upTime', title: '播放时长' },
            ],
            queryParams: function (params) {
                var pagination = $('#gridTable').ysTable('getPagination', params);
                var queryString = $('#searchDiv').getWebControls(pagination);
                return queryString;
            }
        });
    }

    function searchGrid() {
        $('#gridTable').ysTable('search');
        resetToolbarStatus();
    }

</script>
